<template>
    <div class="goods-container">
        <h3>{{goodsdesc.title}}</h3>
        <hr>
        <div class="goods-content" v-html="goodsdesc.content"></div>
    </div>
</template>

<script>
    import {
        Toast
    } from "mint-ui";
    export default {
        data() {
            return {
                id: this.$route.params.id,
                goodsdesc: {}
            }
        },
        created() {
            this.getGoodsDesc();
        },
        methods: {
            getGoodsDesc() {
                this.$http.get("api/goods/getdesc/"+this.id).then(result => {
                    if (result.body.status === 0) {
                        this.goodsdesc = result.body.message[0];
                        console.log(this.goodsdesc);
                    } else {
                        Toast("获取图文信息失败");
                    }
                })
            }
        }
    }
</script>

<style lang="scss">
.goods-container{
    padding: 4px;
    h3 {
        color: #26a6ff;
        font-size: 14px;
        text-align: center;
        margin: 15px 0;
    }
    .goods-content{
        img{
            width: 100%;
        }
        
    }
}
</style>